<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>清除浮动方法1</title>
    <style>
        .box {
            width: 900px;
            background-color: gray;
            /* border: 1px solid blue; */
        }

        .box1 {
            float: left;
            width: 200px;
            height: 100px;
            background-color: red;
        }

        .box2 {
            float: left;
            width: 400px;
            height: 100px;
            background-color: purple;
        }
        .footer {
            width: 1000px;
            height: 250px;
            background-color: skyblue;
        }
        .clear {
            /* 清楚浮动方法1：在最后一个浮动的盒子后面添加一个块级盒子并且调用clear: both;清除浮动 */
            clear: both;
            
        }
      
    </style>
</head>

<body>
    <div class="box">
        <div class="box1">大猫</div>
        <div class="box2">小猫</div>
        <div class="clear"></div>
    </div>
    <div class="footer"></div>
</body>

</html>